﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Web.UI;
using System.Diagnostics;

namespace Lilium.Web.Mvc.AjaxControlToolkit
{
	[RequiredResource(typeof(CommonToolkitScripts), LoadOrder = 0)]
	[RequiredResource(typeof(DateTimeScripts), LoadOrder = 1)]
	[RequiredResource(typeof(PopupExtender), LoadOrder = 2)]
	[RequiredResource(typeof(AnimationScripts), LoadOrder = 3)]
	[RequiredResource(typeof(ThreadingScripts), LoadOrder = 4)]
	[CssReference(Constants.ToolkitLibraryName, "Calendar.Calendar.css")]
	[ToolkitScriptReference("Calendar.CalendarBehavior.js", LoadOrder = 5)]
	public class CalendarExtender: ToolkitExtenderBase
	{
		public CalendarExtender(string elementID)
			: base("AjaxControlToolkit.CalendarBehavior", elementID)
		{
		}

		#region public string CssClass

		private string m_CssClass;

		[DefaultValue("")]
		[ExtenderControlProperty]
		[ClientPropertyName("cssClass")]
		public string CssClass { [DebuggerNonUserCodeAttribute] get { return m_CssClass ?? String.Empty; } [DebuggerNonUserCodeAttribute] set { m_CssClass = value; } }

		#endregion

		#region public string Format

		private string m_Format;

		[DefaultValue("d")]
		[ExtenderControlProperty]
		[ClientPropertyName("format")]
		public string Format { [DebuggerNonUserCodeAttribute] get { return m_Format ?? "d"; } [DebuggerNonUserCodeAttribute] set { m_Format = value; } }

		#endregion

		#region public bool Enabled

		private bool m_Enabled = true;

		[DefaultValue(true)]
		[ExtenderControlProperty]
		[ClientPropertyName("enabled")]
		public bool Enabled { [DebuggerNonUserCodeAttribute] get { return m_Enabled; } [DebuggerNonUserCodeAttribute] set { m_Enabled = value; } }

		#endregion

		#region public bool Animated

		private bool m_Animated = true;

		[DefaultValue(true)]
		[ExtenderControlProperty]
		[ClientPropertyName("animated")]
		public bool Animated { [DebuggerNonUserCodeAttribute] get { return m_Animated; } [DebuggerNonUserCodeAttribute] set { m_Animated = value; } }

		#endregion

		#region public FirstDayOfWeek FirstDayOfWeek

		private FirstDayOfWeek m_FirstDayOfWeek = FirstDayOfWeek.Default;

		[DefaultValue(FirstDayOfWeek.Default)]
		[ExtenderControlProperty]
		[ClientPropertyName("firstDayOfWeek")]
		public FirstDayOfWeek FirstDayOfWeek { [DebuggerNonUserCodeAttribute] get { return m_FirstDayOfWeek; } [DebuggerNonUserCodeAttribute] set { m_FirstDayOfWeek = value; } }

		#endregion

		#region public string PopupButtonID

		private string m_PopupButtonID;

		[DefaultValue("")]
		[ExtenderControlProperty]
		[ClientPropertyName("button")]
		[ElementReference]
		[IDReferenceProperty]
		[SuppressMessage("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase", Justification = "Following ASP.NET AJAX pattern")]
		public string PopupButtonID { [DebuggerNonUserCodeAttribute] get { return m_PopupButtonID ?? string.Empty; } [DebuggerNonUserCodeAttribute] set { m_PopupButtonID = value; } }

		#endregion

		#region public CalendarPosition PopupPosition

		private CalendarPosition m_PopupPosition = CalendarPosition.BottomLeft;

		[ExtenderControlProperty]
		[ClientPropertyName("popupPosition")]
		[DefaultValue(CalendarPosition.BottomLeft)]
		[Description("Indicates where you want the calendar displayed, bottom or top of the textbox.")]
		public CalendarPosition PopupPosition { [DebuggerNonUserCodeAttribute] get { return m_PopupPosition; } [DebuggerNonUserCodeAttribute] set { m_PopupPosition = value; } }

		#endregion

		[DefaultValue(null)]
		[ExtenderControlProperty]
		[ClientPropertyName("selectedDate")]
		public DateTime? SelectedDate
		{
			get;
			set;
		}

		#region public string OnClientShowing

		private string m_OnClientShowing; 

		[DefaultValue("")]
		[ExtenderControlEvent]
		[ClientPropertyName("showing")]
		public string OnClientShowing { [DebuggerNonUserCodeAttribute] get { return m_OnClientShowing ?? string.Empty; } [DebuggerNonUserCodeAttribute] set { m_OnClientShowing = value; } }

		#endregion

		#region public string OnClientShown

		private string m_OnClientShown;

		[DefaultValue("")]
		[ExtenderControlEvent]
		[ClientPropertyName("shown")]
		public string OnClientShown { [DebuggerNonUserCodeAttribute] get { return m_OnClientShown ?? string.Empty; } [System.Diagnostics.DebuggerNonUserCodeAttribute] set { m_OnClientShown = value; } }

		#endregion

		#region public string OnClientHiding

		private string m_OnClientHiding;

		[DefaultValue("")]
		[ExtenderControlEvent]
		[ClientPropertyName("hiding")]
		public string OnClientHiding { [DebuggerNonUserCodeAttribute] get { return m_OnClientHiding ?? string.Empty; } [DebuggerNonUserCodeAttribute] set { m_OnClientHiding = value; } }

		#endregion

		#region public string OnClientHidden

		private string m_OnClientHidden;

		[DefaultValue("")]
		[ExtenderControlEvent]
		[ClientPropertyName("hidden")]
		public string OnClientHidden { [DebuggerNonUserCodeAttribute] get { return m_OnClientHidden ?? string.Empty; } [DebuggerNonUserCodeAttribute] set { m_OnClientHidden = value; } }

		#endregion

		#region public string OnClientDateSelectionChanged

		private string m_OnClientDateSelectionChanged;

		[DefaultValue("")]
		[ExtenderControlEvent]
		[ClientPropertyName("dateSelectionChanged")]
		public string OnClientDateSelectionChanged { [DebuggerNonUserCodeAttribute] get { return m_OnClientDateSelectionChanged ?? string.Empty; } [DebuggerNonUserCodeAttribute] set { m_OnClientDateSelectionChanged = value; } }

		#endregion
	}
}